package com.example.demo.api;

public enum ResultCode implements Result{

    /*操作成功*/
    U_LOGIN_SUCCESS(200, "登录成功"),
    A_LOGIN_SUCCESS(200, "管理员登录成功"),
    LOGOUT_SUCCESS(200, "退出登录成功"),
    GET_INFO_SUCCESS(200, "查看成功"),
    ADD_RESERVATION_SUCCESS(200, "预定成功"),
    CANCEL_SUCCESS(200, "取消成功"),
    ADD_STADIUM_SUCCESS(200, "增加成功"),
    DELETE_STADIUM_SUCCESS(200,"删除成功"),
    PUT_INFO_SUCCESS(200, "修改成功"),

    /*操作失败*/
    TOKEN_FAILED(500, "权限不足"),
    PASSWORD_FAILED(500, "用户名或密码错误"),
    USERNAME_FAILED(500, "该用户不存在"),
    LOGIN_FAILED(500, "登录失败"),

    LOGOUT_FAILED(500, "退出登录失败"),
    GET_INFO_FAILED(500, "查看失败"),
    ADD_RESERVATION_FAILED(500, "预定失败"),
    RESERVATION_FAILED(500, "该时间已被预定"),
    CANCEL_FAILED(500, "取消失败"),
    ADD_STADIUM_FAILED(500, "增加失败"),
    STADIUM_FAILED(500, "场地号冲突"),
    DELETE_STADIUM_FAILED(500,"删除失败"),
    PUT_INFO_FAILED(500,"修改失败");


    private long code;
    private String message;

    private ResultCode(long code, String message) {
        this.code = code;
        this.message = message;
    }

    public long getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
